const app = getApp();

Page({
  data: {
    // info: {_id: 1, u_name: 123}
    info: app.globalData.user
  },

  onLoad(options) {
    
  },

  onShow() {
    if (typeof this.getTabBar === "function" && this.getTabBar()) {
      this.getTabBar().setData({
        selected: 3,
      });
    }
    this.setData({ info: app.globalData.user });
  },

  onChangeCompanyMode() {
    wx.navigateTo({
      url: '/pages/authorize/authorize',
    })
  },

  onJump(e) {
    wx.navigateTo(e.currentTarget.dataset);
  },

  onWarn() {
    wx.showToast({
      title: '您当前还未参与志愿活动',
      icon: 'none',
      duration: 1500
    });
  },

  onLogout() {
    wx.showModal({
      title: '提示',
      content: '确认退出登录？',
      complete: (res) => {
        if (res.confirm) {
          app.globalData.header = null;
          app.globalData.user = null;
          this.setData({ info: {} });
        }
      }
    });
  },
})